using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Unit_UnitCollision_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            Type[] args;
            Type type = typeof(huqiang.Unit.UnitCollision);
            args = new Type[]{typeof(huqiang.Unit.Unit), typeof(huqiang.Unit.Unit)};
            method = type.GetMethod("Add", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Add_0);
            args = new Type[]{typeof(huqiang.Unit.Unit), typeof(huqiang.Unit.UnitCarrier)};
            method = type.GetMethod("Add", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Add_1);
            args = new Type[]{typeof(huqiang.Unit.UnitCarrier), typeof(huqiang.Unit.UnitCarrier)};
            method = type.GetMethod("Add", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Add_2);
            args = new Type[]{};
            method = type.GetMethod("Clear", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Clear_3);
            args = new Type[]{};
            method = type.GetMethod("Collision", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Collision_4);
            args = new Type[]{typeof(huqiang.Unit.Unit), typeof(System.Collections.Generic.List<huqiang.Unit.Unit>)};
            method = type.GetMethod("CircleToCircle", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, CircleToCircle_5);
            args = new Type[]{typeof(System.Collections.Generic.List<huqiang.Unit.Unit>), typeof(System.Collections.Generic.List<huqiang.Unit.Unit>)};
            method = type.GetMethod("CircleToCircle", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, CircleToCircle_6);
            args = new Type[]{typeof(huqiang.Unit.Unit), typeof(System.Collections.Generic.List<huqiang.Unit.Unit>)};
            method = type.GetMethod("CircleToPollygon", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, CircleToPollygon_7);
            args = new Type[]{typeof(System.Collections.Generic.List<huqiang.Unit.Unit>), typeof(System.Collections.Generic.List<huqiang.Unit.Unit>)};
            method = type.GetMethod("CircleToPollygon", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, CircleToPollygon_8);
            args = new Type[]{typeof(System.Collections.Generic.List<huqiang.Unit.Unit>), typeof(System.Collections.Generic.List<huqiang.Unit.Unit>)};
            method = type.GetMethod("PollygonToPollygon", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, PollygonToPollygon_9);
            args = new Type[]{typeof(System.Collections.Generic.List<huqiang.Unit.Unit>), typeof(System.Collections.Generic.List<huqiang.Unit.Unit>)};
            method = type.GetMethod("CircleToCapsules", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, CircleToCapsules_10);
            args = new Type[]{typeof(System.Collections.Generic.List<huqiang.Unit.Unit>), typeof(System.Collections.Generic.List<huqiang.Unit.Unit>)};
            method = type.GetMethod("PollygonToCapsules", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, PollygonToCapsules_11);
            args = new Type[]{typeof(huqiang.Unit.Unit), typeof(System.Collections.Generic.List<huqiang.Unit.Unit>)};
            method = type.GetMethod("CapsulesToCircle", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, CapsulesToCircle_12);
            args = new Type[]{typeof(huqiang.Unit.Unit), typeof(System.Collections.Generic.List<huqiang.Unit.Unit>)};
            method = type.GetMethod("CapsulesToPollygon", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, CapsulesToPollygon_13);



            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Unit.UnitCollision());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Unit.UnitCollision[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* Add_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Unit.Unit @other = (huqiang.Unit.Unit)typeof(huqiang.Unit.Unit).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Unit.Unit @one = (huqiang.Unit.Unit)typeof(huqiang.Unit.Unit).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.Add(@one, @other);

            return __ret;
        }

        static StackObject* Add_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Unit.UnitCarrier @other = (huqiang.Unit.UnitCarrier)typeof(huqiang.Unit.UnitCarrier).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Unit.Unit @one = (huqiang.Unit.Unit)typeof(huqiang.Unit.Unit).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.Add(@one, @other);

            return __ret;
        }

        static StackObject* Add_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Unit.UnitCarrier @other = (huqiang.Unit.UnitCarrier)typeof(huqiang.Unit.UnitCarrier).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Unit.UnitCarrier @one = (huqiang.Unit.UnitCarrier)typeof(huqiang.Unit.UnitCarrier).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.Add(@one, @other);

            return __ret;
        }

        static StackObject* Clear_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            huqiang.Unit.UnitCollision.Clear();

            return __ret;
        }

        static StackObject* Collision_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            huqiang.Unit.UnitCollision.Collision();

            return __ret;
        }

        static StackObject* CircleToCircle_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Collections.Generic.List<huqiang.Unit.Unit> @po = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Unit.Unit @cir = (huqiang.Unit.Unit)typeof(huqiang.Unit.Unit).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.CircleToCircle(@cir, @po);

            return __ret;
        }

        static StackObject* CircleToCircle_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Collections.Generic.List<huqiang.Unit.Unit> @po = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Collections.Generic.List<huqiang.Unit.Unit> @cir = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.CircleToCircle(@cir, @po);

            return __ret;
        }

        static StackObject* CircleToPollygon_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Collections.Generic.List<huqiang.Unit.Unit> @po = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Unit.Unit @cir = (huqiang.Unit.Unit)typeof(huqiang.Unit.Unit).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.CircleToPollygon(@cir, @po);

            return __ret;
        }

        static StackObject* CircleToPollygon_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Collections.Generic.List<huqiang.Unit.Unit> @po = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Collections.Generic.List<huqiang.Unit.Unit> @cir = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.CircleToPollygon(@cir, @po);

            return __ret;
        }

        static StackObject* PollygonToPollygon_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Collections.Generic.List<huqiang.Unit.Unit> @po = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Collections.Generic.List<huqiang.Unit.Unit> @cir = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.PollygonToPollygon(@cir, @po);

            return __ret;
        }

        static StackObject* CircleToCapsules_10(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Collections.Generic.List<huqiang.Unit.Unit> @po = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Collections.Generic.List<huqiang.Unit.Unit> @cir = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.CircleToCapsules(@cir, @po);

            return __ret;
        }

        static StackObject* PollygonToCapsules_11(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Collections.Generic.List<huqiang.Unit.Unit> @po = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Collections.Generic.List<huqiang.Unit.Unit> @cir = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.PollygonToCapsules(@cir, @po);

            return __ret;
        }

        static StackObject* CapsulesToCircle_12(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Collections.Generic.List<huqiang.Unit.Unit> @po = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Unit.Unit @a = (huqiang.Unit.Unit)typeof(huqiang.Unit.Unit).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.CapsulesToCircle(@a, @po);

            return __ret;
        }

        static StackObject* CapsulesToPollygon_13(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Collections.Generic.List<huqiang.Unit.Unit> @po = (System.Collections.Generic.List<huqiang.Unit.Unit>)typeof(System.Collections.Generic.List<huqiang.Unit.Unit>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Unit.Unit @a = (huqiang.Unit.Unit)typeof(huqiang.Unit.Unit).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Unit.UnitCollision.CapsulesToPollygon(@a, @po);

            return __ret;
        }




        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Unit.UnitCollision();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
